﻿/*
 * Twipler - Twitter Web Client with features.
 *  
 *  Copyright (C) 2009, 2010. Ian Quigley
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details. 
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Twipler.App.Render.Tree;
using UnitTests.App.Parse.Producer;

namespace UnitTests.App.Parse
{
    public class ArrangeHtmlParser
    {
        private readonly AbstractProducerTest _tester;

        public ArrangeHtmlParser(AbstractItem item)
        {
            _tester = Factory.Select(item);
            if (_tester == null)
                throw new ArgumentException("Unhandled AbtractItem Type " + item.GetType().ToString());
        }

        public void BuildTest(StringBuilder test)
        {
            _tester.TestString(test);
        }

        public string TestCase
        {
            get
            {
                StringBuilder test = new StringBuilder();
                BuildTest(test);
                return test.ToString();
            }
        }

        public void AssertSame(AbstractItem result)
        {
            _tester.AssertSame(result);
        }
    }
}
